﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BenchItem:PosFixedItem
{
    public BenchField NewSetting;
    public override ItemField ItemFieldSetting { get => NewSetting; set => NewSetting= value as BenchField; }
    public override void DownloadInstanceField(object args)
    {
        base.DownloadInstanceField(args);
        this.GetComponent<BenchInteraction>().IsOpen = GetField<BenchField>().IsOpen;

    }
    public override ItemField UploadInstanceField()
    {
        GetField<BenchField>().IsOpen = this.GetComponent<BenchInteraction>().IsOpen;
        return base.UploadInstanceField();
    }
}

[System.Serializable]
public class BenchField : PosFixedItemField
{
    [HideInInspector]
    public bool IsOpen;
}